FROM alpine-base

COPY cpanfile /
ENV EV_EXTRA_DEFS -DEV_NO_ATFORK

RUN apk update && \
  apk add perl perl-io-socket-ssl perl-dbd-pg perl-dev g++ make tar unzip wget curl  

RUN curl -L https://cpanmin.us | perl - App::cpanminus 

RUN cpanm --installdeps . -n -M https://cpan.metacpan.org

RUN  rm -rf /root/.cpanm/* 
RUN mkdir /app
WORKDIR /app
RUN apk add fish vim libxml2-dev

# RUN adduser -s /bin/bash -D rchen
# USER rchen

EXPOSE 3000 80 443 22
